<?php
	if(!defined('BASEPATH'))
		exit('No direct script access allowed');

	class m_LinkToVendor extends CI_Model
	{
		function __construct()
    	{
    	    // Call the Model constructor
    	    parent::__construct();
    	}

    	function get_user_id($userEmail)
    	{
			$this->load->database();
			$this->db->select('userId')->from('tblUser')->where('userEmail', $userEmail);
			$query = $this->db->get();
			return $query;
    	}
		
		function link($Vendor_ID, $userId, $AccountNumber)
		{
			$this->load->database();
			$data = array(
				'userId' => "$userId",
				'Vendor_ID' => "$Vendor_ID",
				'AccountNumber' => "$AccountNumber"
			);
			$this->db->insert('tblVendorLinks', $data);
		}
	}
?>
